package com.company.project.controller.ldjsc.meeting;


import com.company.project.common.utils.DataResult;
import com.company.project.entity.ldjsc.home.CockpitContentEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sxzy/meeting")
@Api(tags = "视频会议-提取音频")
public class MeetingContentController {


    @ApiOperation(value = "提取音频")
    @PostMapping("/content")
    @ResponseBody
    public DataResult extractAudio(){
        // 检查FFmpeg是否可用
        if (!FFmpegAudioExtractor.isFFmpegAvailable()) {
            return DataResult.fail("FFmpeg未安装或不可用");
        }

        try {
            // 提取音频
            FFmpegAudioExtractor.extractAudio("input.mp4", "output412414.wav");
            return DataResult.success("音频提取完成");
        } catch (Exception e) {
            return DataResult.success("音频提取失败:" + e.getMessage());
        }
    }


}
